import request from "@/utils/request";
import { AxiosPromise } from "axios";
import { ModelGetTemp, ModelSetTemp } from "./types";

// 获取分销商回传模板
export function getAdsSettingFeedback(
  data: ModelGetTemp
): AxiosPromise<Record<string, any>> {
  return request({
    url: "/api/AdsSettingFeedback",
    method: "get",
    params: data,
  });
}

// 设置分销商回传模板
export function setAdsSettingFeedback(
  data: ModelSetTemp
): AxiosPromise<Record<string, any>> {
  return request({
    url: `/api/AdsSettingFeedback`,
    method: "put",
    data,
  });
}

// 全局设置 - 获取分销商默认回传模板
export function getAdsFeedback(
  data: Record<string, any>
): AxiosPromise<Record<string, any>> {
  return request({
    url: `/api/Apps/${data.appId}/ads-feedback?platform=${data.platform}`,
    method: "get",
  });
}

// 全局设置 - 设置分销商默认回传模板
export function setAdsFeedback(
  data: ModelSetTemp
): AxiosPromise<Record<string, any>> {
  return request({
    url: `/api/Apps/${data.appId}/ads-feedback`,
    method: "put",
    data,
  });
}
